package com.qi.spzx.product.mapper;

import com.qi.spzx.model.dto.h5.ProductSkuDto;
import com.qi.spzx.model.entity.product.ProductSku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2024/2/25 17:13
 * @Version 1.0.0
 */
@Mapper
public interface ProductSkuMapper {

    List<ProductSku> findProductSkuBySale();

    List<ProductSku> findByPage(ProductSkuDto productSkuDto);

    @Select("select * from product_sku where id = #{skuId} and is_deleted = 1;")
    ProductSku selectBySkuId(Long skuId);

    @Select("select * from product_sku where product_id = #{productId} and is_deleted = 1")
    List<ProductSku> findByProductId(Long productId);
}
